package lib.wman.org.mvvm;

import android.os.Bundle;
import android.view.View;

import lib.wman.org.mvvm.databind.DataBindActivity;
import lib.wman.org.mvvm.databinding.DelegateDemoBinding;

public class MainActivity extends DataBindActivity<MainDelegate, DelegateDemoBinding> {

    JavaBean data = new JavaBean("名字");

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding.setJavabean(data);
        binding.setPresenter(this);
    }

    public void clickButton(View view) {
        data.setName("wman");
        //通知数据发生了改变
        binding.setJavabean(data);
    }

    @Override
    protected Class getDelegateClass() {
        return MainDelegate.class;
    }
}